<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="${request.contextPath}/"/>
    <meta charset="UTF-8">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,minimum-scale=1.0">
    <title>收货地址列表</title>
    <link href="Content/wechat/css/reset.css" rel="stylesheet" type="text/css">
    <link href="Content/wechat/css/dangJian_zaiXianXueXi.css" rel="stylesheet" type="text/css">
    <script src="Content/wechat/js/jquery.min.js"></script>
    <!--字体缩放-->
    <script src="/Content/wechat/js/ziti.js"></script>
    <!--end 字体缩放-->
    <!--页码js-->
    <script src="/Content/wechat/js/myPagination.js"></script>
    <!--页码-->
    <link href="/Content/wechat/css/myPagination.css" rel="stylesheet" type="text/css">
</head>
<body>

<div class="dianLiang_list">
    <div class="dianLiang_list_box">
        <ul id="liuYan_box">

        </ul>
    </div>
    <!--页码-->
    <div id="pagination" class="pagination"></div>
</div>
<div class="nav_bottom clearfix">
    <button onclick=window.location="/wechat/personage/set/address/Info">+ 添加收货地址</button>

</div>

</body>


<script>
    var pageTotal = 0;   //总页数
    var pageSize = 10;    //一页显示几个
    window.onload = function () {
        InitAjax(1);
    }

    function onLoadPaging() {
        new myPagination({
            id: 'pagination',
            curPage: 1, //初始页码
            pageTotal: pageTotal, //总页数
            pageAmount: pageSize,  //每页多少条
            pageSize: 2, //可选,分页个数

            getPage: function (page) {
                //获取当前页数
                InitAjax(page)
            }
        })
    }

    function InitAjax(pageNum) {
        $.ajax({
            url: "/wechat/personage/set/address/List",
            type: 'post',
            dataType: 'json',
            data: {
                pagination: "{page:\"" + pageNum + "\",rows:\"" + pageSize + "\",sidx:\"\",sord:\"\"}",
                type: "求职招聘"
            }, success: function (result) {
                ajaxCallBack(result);
            }

        })
    }

    function ajaxCallBack(data) {
        var insetViewData = ""; //视图数据
        $.each(data.data.rows, function (index, items) {
            if(items.isdef=="1"){
                insetViewData+="<li onclick=window.location=\"/wechat/personage/set/address/Info?id="+items.id+"\">\n" +
                    "                <div class=\"wz_r\">\n" +
                    "                    <h4 style=\"font-size: 0.5rem\"><em style=\"color: red\">[默认]</em>"+items.name+"&nbsp;&nbsp;&nbsp;<em style='float: right;'>"+items.phone+"</em></h4>\n" +
                    "                    <h4>"+items.provincename+items.cityname+items.regionname+items.info+"</h4>\n" +
                    "                </div>\n" +
                    "            </li>";

            }else{
                insetViewData+="<li onclick=window.location=\"/wechat/personage/set/address/Info?id="+items.id+"\">\n" +
                    "                <div class=\"wz_r\">\n" +
                    "                    <h4 style=\"font-size: 0.5rem\">"+items.name+"&nbsp;&nbsp;&nbsp;<em style='float: right;'>"+items.phone+"</em></h4>\n" +
                    "                    <h4>"+items.provincename+items.cityname+items.regionname+items.info+"</h4>\n" +
                    "                </div>\n" +
                    "            </li>";
            }

        });
        $("#liuYan_box").html(insetViewData);
        if (pageTotal == 0) {
            pageTotal = data.data.total;
            onLoadPaging()
        }
    }


</script>
</html>
